package interfaceusuario;

import java.awt.Color;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Toolkit;

import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;

import propertieslinguagem.SingletonSetaLinguagemEArmazenaResourceBundle;

public class TelaEnsinaAoUsuarioSobreManterEstadoDasVariaveis 
{
	private JFrame janelaEnsina;
	
	public TelaEnsinaAoUsuarioSobreManterEstadoDasVariaveis()
	{
		SingletonSetaLinguagemEArmazenaResourceBundle conheceLinguagemDoSistema = 
				SingletonSetaLinguagemEArmazenaResourceBundle.getInstance();
		String titulojanelaEnsina = conheceLinguagemDoSistema.getString("janelaEnsinaTelaEnsinaAoUsuarioSobreManterEstadoDasVariaveis");
		
		janelaEnsina = new JFrame(titulojanelaEnsina);
		janelaEnsina.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
		ImageIcon iconeMascoteParaJFrame = CriadorImageIcon.criarImageIcon("imagens/meganeiconjframe2.jpg", "testableIcon");
		this.janelaEnsina.setIconImage(iconeMascoteParaJFrame.getImage());
		Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
		janelaEnsina.setSize(d);
		janelaEnsina.setAlwaysOnTop(true);
		this.desenharTelaEnsinaAoUsuarioSobreManterEstadoDasVariaveis();
	}
	
	public void desenharTelaEnsinaAoUsuarioSobreManterEstadoDasVariaveis()
	{
		CriaPainelDeFundoComBackground criaPainelPadrao = CriaPainelDeFundoComBackground.getInstance();
		JPanel painelComImagemDeFundo = criaPainelPadrao.criarPainelDeFundoPadraoDoSistema();
		GridBagLayout layoutPainelComImagemDeFundo = new GridBagLayout();
		painelComImagemDeFundo.setLayout(layoutPainelComImagemDeFundo);
		
		GridBagConstraints grid = new GridBagConstraints();
		
		SingletonSetaLinguagemEArmazenaResourceBundle conheceLinguagemDoSistema = 
				SingletonSetaLinguagemEArmazenaResourceBundle.getInstance();
		String textotitulo = conheceLinguagemDoSistema.getString("tituloTelaEnsinaAoUsuarioSobreManterEstadoDasVariaveis");
		
		JLabel titulo = CriadorTextLabel.criarTextlabel(textotitulo, 30);
		JPanel painelTitulo = criaPainelPadrao.criarPainelDeFundoPadraoDoSistema();
		
		painelTitulo.add(titulo);
		
		grid.gridx = 0;
		grid.gridy = 0;
		painelComImagemDeFundo.add(painelTitulo,grid);
		
		grid.gridy = 1;
		grid.gridheight = 19;
		JPanel painelExplicacao = criarPainelExplicacao();
		painelComImagemDeFundo.add(painelExplicacao,grid);
		
		this.janelaEnsina.add(painelComImagemDeFundo);
		this.janelaEnsina.setVisible(true);
	}
	
	public JPanel criarPainelExplicacao()
	{
		SingletonSetaLinguagemEArmazenaResourceBundle conheceLinguagemDoSistema = 
				SingletonSetaLinguagemEArmazenaResourceBundle.getInstance();
		String textol1 = conheceLinguagemDoSistema.getString("l1TelaEnsinaAoUsuarioSobreManterEstadoDasVariaveis");
		String textol12 = conheceLinguagemDoSistema.getString("l12TelaEnsinaAoUsuarioSobreManterEstadoDasVariaveis");
		String textol13 = conheceLinguagemDoSistema.getString("l13TelaEnsinaAoUsuarioSobreManterEstadoDasVariaveis");
		String textol14 = conheceLinguagemDoSistema.getString("l14TelaEnsinaAoUsuarioSobreManterEstadoDasVariaveis");
		String textol15 = conheceLinguagemDoSistema.getString("l15TelaEnsinaAoUsuarioSobreManterEstadoDasVariaveis");
		String textol17 = conheceLinguagemDoSistema.getString("l17TelaEnsinaAoUsuarioSobreManterEstadoDasVariaveis");
		String textol18 = conheceLinguagemDoSistema.getString("l18TelaEnsinaAoUsuarioSobreManterEstadoDasVariaveis");
		String textol19 = conheceLinguagemDoSistema.getString("l19TelaEnsinaAoUsuarioSobreManterEstadoDasVariaveis");
		
		JLabel l1 = new JLabel(textol1);
		JLabel l2 = new JLabel("public int getX()");
		JLabel l3 = new JLabel("{                ");
		JLabel l4 = new JLabel("       return x; ");
		JLabel l5 = new JLabel("}                ");
		JLabel l6 = new JLabel("                 ");
		JLabel l7 = new JLabel("public void setX(int x)");
		JLabel l8 = new JLabel("{                ");
		JLabel l9 = new JLabel("     this.x = x; ");
		JLabel l10 = new JLabel("}                ");
		JLabel l11 = new JLabel("                 ");
		JLabel l12 = new JLabel(textol12);
		JLabel l13 = new JLabel(textol13);
		JLabel l14 = new JLabel(textol14);
		JLabel l15 = new JLabel(textol15);
		JLabel l16 = new JLabel("                 ");
		JLabel l17 = new JLabel(textol17);
		JLabel l18 = new JLabel(textol18);
		JLabel l19 = new JLabel(textol19);
		
		l1.setFont(new Font("Berlin Sans FB Demi", Font.BOLD, 20));
		l2.setFont(new Font("Berlin Sans FB Demi", Font.BOLD, 20));
		l3.setFont(new Font("Berlin Sans FB Demi", Font.BOLD, 20));
		l4.setFont(new Font("Berlin Sans FB Demi", Font.BOLD, 20));
		l5.setFont(new Font("Berlin Sans FB Demi", Font.BOLD, 20));
		l6.setFont(new Font("Berlin Sans FB Demi", Font.BOLD, 20));
		l7.setFont(new Font("Berlin Sans FB Demi", Font.BOLD, 20));
		l8.setFont(new Font("Berlin Sans FB Demi", Font.BOLD, 20));
		l9.setFont(new Font("Berlin Sans FB Demi", Font.BOLD, 20));
		l10.setFont(new Font("Berlin Sans FB Demi", Font.BOLD, 20));
		l11.setFont(new Font("Berlin Sans FB Demi", Font.BOLD, 20));
		l12.setFont(new Font("Berlin Sans FB Demi", Font.BOLD, 20));
		l13.setFont(new Font("Berlin Sans FB Demi", Font.BOLD, 20));
		l14.setFont(new Font("Berlin Sans FB Demi", Font.BOLD, 17));
		l15.setFont(new Font("Berlin Sans FB Demi", Font.BOLD, 20));
		l16.setFont(new Font("Berlin Sans FB Demi", Font.BOLD, 20));
		l17.setFont(new Font("Berlin Sans FB Demi", Font.BOLD, 20));
		l18.setFont(new Font("Berlin Sans FB Demi", Font.BOLD, 20));
		l19.setFont(new Font("Berlin Sans FB Demi", Font.BOLD, 20));
		
		l1.setForeground(new Color(84, 18, 13));
		l2.setForeground(new Color(84, 18, 13));
		l3.setForeground(new Color(84, 18, 13));
		l4.setForeground(new Color(84, 18, 13));
		l5.setForeground(new Color(84, 18, 13));
		l6.setForeground(new Color(84, 18, 13));
		l7.setForeground(new Color(84, 18, 13));
		l8.setForeground(new Color(84, 18, 13));
		l9.setForeground(new Color(84, 18, 13));
		l10.setForeground(new Color(84, 18, 13));
		l11.setForeground(new Color(84, 18, 13));
		l12.setForeground(new Color(84, 18, 13));
		l13.setForeground(new Color(84, 18, 13));
		l14.setForeground(new Color(84, 18, 13));
		l15.setForeground(new Color(84, 18, 13));
		l16.setForeground(new Color(84, 18, 13));
		l17.setForeground(new Color(84, 18, 13));
		l18.setForeground(new Color(84, 18, 13));
		l19.setForeground(new Color(84, 18, 13));
		
		CriaPainelDeFundoComBackground criaPainelPadrao = CriaPainelDeFundoComBackground.getInstance();
		JPanel painelExplicacao = criaPainelPadrao.criarPainelDeFundoPadraoDoSistema();
		GridBagLayout layoutPainelComImagemDeFundo = new GridBagLayout();
		painelExplicacao.setLayout(layoutPainelComImagemDeFundo);
		
		GridBagConstraints grid = new GridBagConstraints();
		//grid.anchor = GridBagConstraints.WEST;
		grid.gridy = 0;
		painelExplicacao.add(l1,grid);
		grid.gridy = 1;
		painelExplicacao.add(l2,grid);
		grid.gridy = 2;
		painelExplicacao.add(l3,grid);
		grid.gridy = 3;
		painelExplicacao.add(l4,grid);
		grid.gridy = 4;
		painelExplicacao.add(l5,grid);
		grid.gridy = 5;
		painelExplicacao.add(l6,grid);
		grid.gridy = 6;
		painelExplicacao.add(l7,grid);
		grid.gridy = 7;
		painelExplicacao.add(l8,grid);
		grid.gridy = 8;
		painelExplicacao.add(l9,grid);
		grid.gridy = 9;
		painelExplicacao.add(l10,grid);
		grid.gridy = 10;
		painelExplicacao.add(l11,grid);
		grid.gridy = 11;
		painelExplicacao.add(l12,grid);
		grid.gridy = 12;
		painelExplicacao.add(l13,grid);
		grid.gridy = 13;
		painelExplicacao.add(l14,grid);
		grid.gridy = 14;
		painelExplicacao.add(l15,grid);
		grid.gridy = 15;
		painelExplicacao.add(l16,grid);
		grid.gridy = 16;
		painelExplicacao.add(l17,grid);
		grid.gridy = 17;
		painelExplicacao.add(l18,grid);
		grid.gridy = 18;
		painelExplicacao.add(l19,grid);
		
		return painelExplicacao;
	}
}
